<?php 

class Logincon extends CI_Controller {
    
        public function __construct() {
        parent::__construct();
        $this->load->library('form_validation');
        
        }
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{            
                     
            //$this->load->helper(array('home', 'url'));
          /*
            $this->form_validation->set_rules('Ficha', 'Ficha', 'required|integer|is_natural');
            $this->form_validation->set_rules('Nombre', 'Nombre', 'required|alpha|min_length[4]');
            $this->form_validation->set_rules('Dir_Emp', 'Direccion', 'required|max_length[70]');
            $this->form_validation->set_rules('Est_Civil', 'Estado Civil', 'required|alpha');
            $this->form_validation->set_rules('Sexo', 'Estado Civil', 'required');
            $this->form_validation->set_rules('F_Nac', 'Fecha de Nacimiento', 'required');
            $this->form_validation->set_rules('F_Ing', 'Fecha de Ingreso', 'required');
            $this->form_validation->set_rules('F_Egr', 'Fecha de Egreso', 'required');
            $this->form_validation->set_rules('Status', 'Estatus', 'required');
            $this->form_validation->set_rules('S_Dev', 'S_Dev', 'required');
            $this->form_validation->set_rules('Ficha_J', 'Ficha del Jefe', 'required|integer|is_natural');
            $this->form_validation->set_rules('Cod_B', 'Código Bancario', 'required|integer|is_natural');
            $this->form_validation->set_rules('Cod_S', 'Código Sucursal', 'required|integer|is_natural');
            $this->form_validation->set_rules('Cod_TD', 'Código Departamento', 'required|integer|is_natural');            
                      
		}*/
                
            $this->form_validation->set_error_delimiters('<span class="mensaje-error">','</span>');
            if ($this->form_validation->run('Login') === FALSE)
		{                    
                    $this->load->view('frontend/Login');                    
		}
		else
		{
                    $this->load->view('Menu/mMenu');                                  
                                     
		}    
	}
        
         function login_sucess(){
            
           /* $session = array(
            'nombre' => $this->input->post('nombre'),
            'password' => $this->input->post('password'),
            'Session' => $this->input->post('L_Name')
            ); */             
          $mainmenu = $this->load->view('Menu/mMenu');
          $mainmenu;
            $this->form_validation->set_error_delimiters('<span class="mensaje-error">','</span>');
            if ($this->form_validation->run('Menu') === FALSE)
		{                    
                    $this->load->view('Menu/mMenu');                    
		}
		else
		{
                    $this->Tabla();               
                                    
		}		
        }
        
        function Tabla(){
         $empleado =  $this->load->view('dbwindows/Empleado');
         $empleadoclean = $this->load->view('Clean/Empleado');
         $empleado;
            if ($this->form_validation->run('Empleado') === FALSE)
		{                    
                    $this->load->view('dbwindows/Empleado');                    
		}
		else
		{
                     $empleadoclean;               
                                    
		}
        }
       
        
        
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
